def fire():
    # 定义一个文件路径
    file_path = 'D:\\users\\test.txt'
    # 以写的方式打开一个文件
    with open(file_path, "w") as file:
        # 定义一个字符串数字
        data = ["hogwarts\n", "ck_28\n", "yftest\n", "pyfile\n"]
        # 把字符串写入文件
        file.writelines(data)
    # 以读的方式打开一个文件
    with open(file_path, "r") as file:
        # 打印读取内容
        print(file.read())


fire()
